package com.hb.trade.server.project.complaint.controller;

import com.hb.core.pojo.project.complaint.dto.ComplaintReplyDTO;
import com.hb.trade.server.project.complaint.service.ComplaintReplyService;
import org.fzzn.core.model.enums.MsgEnum;
import org.fzzn.core.model.msg.Message;
import org.fzzn.core.util.MsgUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 招标人回复异议 控制器
 *
 * @author ljs
 * @date 2022-1-26 11:54:22
 */
@RestController
public class ComplaintReplyController{

    @Autowired
    private ComplaintReplyService complaintReplyService;

    @PostMapping("/complaintReply/save")
    public Message saveComplaintReply(@RequestBody ComplaintReplyDTO complaintReplyDTO) {
        if (null==complaintReplyDTO || null==complaintReplyDTO.getComplaintId()){
            return MsgUtil.fail(MsgEnum.INCORRECT_PARAM.msg());
        }
        boolean saveResult = complaintReplyService.saveComplaintReply(complaintReplyDTO);
        return saveResult ? MsgUtil.msg(MsgEnum.SUCCESS) : MsgUtil.fail(MsgEnum.FAILURE.msg());
    }
}
